package com.higgins.lawapp.client.maintenance.handlers;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
import com.higgins.lawapp.client.maintenance.model.DataItemModel;
import com.higgins.lawapp.client.maintenance.presenter.DataItemPresenter;
import com.higgins.lawapp.client.settings.rpc.DataSourceService;
import com.higgins.lawapp.client.settings.rpc.DataSourceServiceAsync;

public class DeleteButtonHandler implements ClickHandler {
	private DataItemPresenter dataItemPresenter;
	
	public DeleteButtonHandler(DataItemPresenter dataItemPresenter)	{
		this.dataItemPresenter = dataItemPresenter;
	}
	
	public void onClick(ClickEvent event) {
		sendNameToServer();
	}

		private void sendNameToServer() {	
			DataItemModel dataItemModel = dataItemPresenter.getDataItemModel();
			dataItemModel.deleteRow();
		}
}
